🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / takserver / src / commonMain / kotlin / org / meshtastic / core / takserver / TakSdkCompressor.kt
Displaying Raw • Download
core/takserver/src/commonMain/kotlin/org/meshtastic/core/takserver/TakSdkCompressor.kt fix/qr-error-correction (7b45f84f) Text, 1.61 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.takserver
Tff7b72import T7ee787org.meshtastic.tak.CotXmlParser
Tff7b72import T7ee787org.meshtastic.tak.TakCompressor
T8b949e/**
* Thin wrapper over the TAKPacket-SDK compression pipeline
* ([org.meshtastic.tak.CotXmlParser] + [org.meshtastic.tak.TakCompressor]).
*
* The SDK is multiplatform since 0.7.0 — zstd dictionary compression rides on its transitive pure-Kotlin kzstd codec —
* so this works on every target.
*/
Tff7b72internal Tff7b72object T56d364TakSdkCompressor Tb4b4b4{
T8b949e/**
* Parse CoT XML via the SDK and compress with remarks-fallback.
*
* @return compressed wire payload, or `null` if the packet exceeds [maxBytes] even without remarks.
* @throws Exception on parse or compression failure.
*/
Tff7b72fun Td2a8ffcompressCoTTb4b4b4(Te6edf3xmlTb4b4b4: Tffa657StringTb4b4b4, Te6edf3maxBytesTb4b4b4: Tffa657IntTb4b4b4)Tb4b4b4: Te6edf3ByteArray? Tb4b4b4{
Tff7b72val Te6edf3sdkData Tff7b72= Te6edf3CotXmlParserTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3parseTb4b4b4(Te6edf3xmlTb4b4b4)
Tff7b72return Te6edf3TakCompressorTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3compressWithRemarksFallbackTb4b4b4(Te6edf3sdkDataTb4b4b4, Te6edf3maxBytesTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s